package cn.edu.ctbu.datajpa01.service;


import cn.edu.ctbu.datajpa01.domain.Student;
import cn.edu.ctbu.datajpa01.repository.StudentRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Example;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

import java.util.List;

@Service

public interface StudentService {

   List<Student> findAll();

   Page<Student> findAll(Pageable pageable);


    /***
     * 分页 带过滤的查询
     *
     */
    Page<Student> findAll(Example<Student> student, Pageable pageable);


    /**
     * 按id进行查询
     * @param id 主键，整数
     * @return
     */
    Student findById(Integer id);


    /**
     * 按名字进行模糊查询 like操作
     * @param name
     * @return
     */


    /**
     * 按 名字和密码进行查询 like操作
     * @param name
     * @return
     */
    List<Student> findByNameAndPassword(String name,String password);

    Student Insert(Student student);
    Student Update(Student student);
    void Delete(Integer id);
    Student getById(Integer id);
    Student getByNo(String no);
   List<Student> findByName(String name);

    }





